package com.chinabank.service;

import java.io.Serializable;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.chinabank.dao.GroupDao;
import com.chinabank.model.Group;


@Service(value = "groupService")
public class GroupService {

	private GroupDao groupDao;
	
	public GroupDao getGroupDao() {
		return groupDao;
	}

	@Resource
	public void setGroupDao(GroupDao groupDao) {
		this.groupDao = groupDao;
	}

	@Transactional
	public void addGroup(Group group) {
		groupDao.add(group);
	}

	@Transactional
	public void delGroup(Group group) {
		groupDao.delete(group);
	}

	@Transactional
	public void updateGroup(Group group) {
		groupDao.update(group);
	}

	@Transactional
	public Group getGroup(Serializable id) {
		return groupDao.get(id);
	}

	@Transactional
	public List<Group> getGroups() {
		return groupDao.getGroups();
	}

}
